<script language="javascript">
var counter = 1;
var limit = 100;
function addInput(divName,num) {ldelim}
     if (counter == limit)   {ldelim}
          alert("You have reached the limit of adding " + counter + " inputs");
     {rdelim}
     else  {ldelim}
          var newdiv = document.createElement('div');
          newdiv.innerHTML = "<br><select style='width: 200px;' class='inp-form' name='structkeyopt'>{$temp_options}</select>&nbsp; <input class='inp-form' style='width: 200px;' type='text' name='structkey' id='structkey' />&nbsp;<input class='inp-form' style='width: 500px;' type='text' name='structval' id='structval' /><br>";
          document.getElementById(divName).appendChild(newdiv);
          counter++;
     {rdelim}
{rdelim}
</script>
<div id="page-heading">
	<h1>{$title}</h1>
</div>
<form method="post" id="myForm" action="{$formaction}">
    <div id="dynamicInput">
      {section name=sec1 loop=$struct_arr}
    <br>
       <select name="structkeyopt" id="structkeyopt" style="width: 200px;">
	{$temp_options}
     </select>
        <input value="{$struct_arr[sec1].structkey}" class="inp-form" style="width: 200px;" type="text" name="structkey" id="structkey" />
       <input value="{$struct_arr[sec1].structvalue}"  class="inp-form" style="width: 500px;" type="text" name="structval" id="structval" />
       <a  href="javascript: void(0);" onclick="deletestructurefield({$struct_arr[sec1].structid},{$productid});"><img src="images/icons/save-2.gif" />Delete</a>
       <br>
     {/section}
    </div>
    <br>
    <input type="button" value="Add another field" onClick="addInput('dynamicInput',1);">
    <div>
	<td>&nbsp;<input type="hidden" name="productid" id="productid" value="{$productid}" />
        <input type="hidden" name="catid" id="productid" value="{$catid}" />
        </td>
	<td><div class="edit-icoset"><a href="javascript: void(0);" onclick="saveFeatures({$productid});"><img src="images/icons/save-2.gif" />Save</a></div>
        <input type="submit" id="btnDel" value="SAVE" />
        </td>
   </div>
</form>